Move revealjs scroll-view from extraConfig to template#14100
Merged
Conversation
Scroll-view options were injected at runtime via extraConfig (JS post- processing). Now they are rendered directly by template.html, matching how other revealjs options are handled. The template uses $if/$else$ guards to render correct JS types for mixed-type options (scrollSnap accepts strings and boolean false, scrollProgress accepts booleans and string 'auto'). This fixes type issues present in Pandoc's upstream template (jgm/pandoc#11486). Closes #13852 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Covers two additional edge cases: - view: scroll set directly (not via scroll-view shorthand) - scroll-view.progress: true (boolean true, not "auto") Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verifies numeric rendering of scrollActivationWidth with a user-specified value (600) rather than only testing the default (0). Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verifies that scrollActivationWidth, scrollSnap, scrollLayout, and scrollProgress do NOT appear in output when scroll-view is not configured. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Group all scroll-view smoke tests under revealjs/scroll-view/ to keep the revealjs test directory organized as coverage grows. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quarto's scroll-view support (PR #11034) predates Pandoc 3.8.3's native revealjs scroll-view template support and uses runtime JavaScript injection (
extraConfig) as a workaround. The scroll-view options are now rendered directly by Quarto'stemplate.htmlusing$if/$else$type guards.Approach
Scroll-view configuration flows through three stages:
revealResolveFormat()normalizes YAML keys and creates ascrollProgressAutohelper flag (Pandoc templates can't distinguish"auto"fromtruesince both are truthy)formatExtras()sets scroll-view defaults inextras.metadata(lowest priority, overridden by user values)template.htmlrenders values with type-safe guards — strings quoted, booleans unquoted, numbers unquotedThe
extraConfiginjection block informatExtras()is removed entirely.Type handling
Pandoc's own revealjs template (jgm/pandoc#11486) has type bugs:
scrollSnap: 'false'renders as a truthy string instead of booleanfalse, andscrollActivationWidthrenders as a string instead of a number. Quarto's template handles these correctly via$if/$else$branching.Tests
10 smoke tests in
tests/docs/smoke-all/revealjs/scroll-view/cover all option combinations: defaults,scrollProgress(true/false/auto),scrollSnap(mandatory/proximity/false),scrollActivationWidth(non-zero), directview: scrollkey, and a negative test verifying scroll options are absent withoutscroll-view.Closes #13852